package com.base.moduleUser.controller;

import com.base.core.common.http.response.AjaxResult;
import com.base.core.domain.User;
import com.base.moduleUser.service.UserService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/test/user")
public class TestController {

    @Resource
    private UserService userService;

    @GetMapping("/info")
    public AjaxResult getUserInfo(@Param("id") Integer id) {
        User user=userService.getById(id);
        return AjaxResult.success(user);
    }

}
